package ihm;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class AccueilVisiteur extends JFrame implements ActionListener {

	private JPanel contentPane;
	private JButton btnVCC;
	private JButton btnVCB;
	private JButton btnAccueil;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					AccueilVisiteur frame = new AccueilVisiteur();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public AccueilVisiteur() {
		setTitle("Accueil Visiteur");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 250);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		btnVCC = new JButton("Consulter Circuit");
		btnVCC.addActionListener(this);
		btnVCC.setBounds(159, 65, 130, 23);
		contentPane.add(btnVCC);
		
		btnVCB = new JButton("Consulter Balade");
		btnVCB.addActionListener(this);
		btnVCB.setBounds(159, 117, 130, 23);
		contentPane.add(btnVCB);
		
		btnAccueil = new JButton("Accueil");
		btnAccueil.addActionListener(this);
		btnAccueil.setBounds(10, 178, 90, 23);
		contentPane.add(btnAccueil);
	}

	
	public void actionPerformed(ActionEvent arg0) {
		if (arg0.getSource()==btnAccueil)
		{
			MenuPrincipal menu=new MenuPrincipal();
			menu.setBounds(100, 100, 700, 450);
			menu.setVisible(true);
			menu.setTitle("Menu Principal");
		}
		
		if (arg0.getSource()==btnVCC)
		{
			ConsulterCircuit pageVC=new ConsulterCircuit();
			pageVC.setBounds(100,100,800,600);
			pageVC.setVisible(true);
			pageVC.setTitle("Consulter circuit");
		}
		
		if (arg0.getSource()==btnVCB)
		{
			ConsulterBalade pageVB=new ConsulterBalade();
			pageVB.setBounds(100,100,800,600);
			pageVB.setVisible(true);
			pageVB.setTitle("Consulter balade");
		}
		this.dispose();
	}
}
